<template>
    <canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0" sytle="width: 100%; height: 100%;">
      <slot v-if="curGame" />
    </canvas>
</template>

<script>
/* eslint-disable */

import initCocos from "../common/ccinit";

export default {
  name: "CocosGame",

  props: {
    designSize:  {
        type: Object,
        default: ()=>{return {width:2048,height:1536}},
    },
  },

  data() {
    return {
      curGame: null,
    };
  },
  mounted() {
    initCocos({frameRate:60},()=>{
      this.curGame = this.designSize;
    });
  },
};
</script>
